package com.kifas.entity;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "tb_detail_penjualan")
public class PenjualanDetailEntity implements Serializable {

	private static final long serialVersionUID = 3657780961804753431L;

	@Id
	@GeneratedValue
	@Column(name = "id_detail_penjualan")
	private Long idDetailPenjualan;

	@ManyToOne
	@JoinColumn(name = "id_barang", nullable = false)
	private BarangEntity barang;

	@ManyToOne
	@JoinColumn(name = "id_penjualan", nullable = false)
	private PenjualanEntity penjualan;

	private Long qty;

	private BigDecimal price;

	@ManyToOne
	@JoinColumn(name = "id_master_gudang", nullable = false)
	private GudangEntity gudang;

	private BigDecimal subTotal;

	@Column(name = "bulan_kadaluarsa")
	private String bulanKadaluarsa;

	private BigDecimal discount;

	private BigDecimal pajak;
	
	@Column(name= "created_by")
	private String createdBy;

	public PenjualanDetailEntity() {
	}

	public PenjualanDetailEntity(Long idDetailPenjualan, BarangEntity barang,
			PenjualanEntity penjualan, Long qty, BigDecimal price,
			GudangEntity gudang, BigDecimal subTotal, String bulanKadaluarsa,
			BigDecimal discount, BigDecimal pajak, String createdBy) {
		this.idDetailPenjualan = idDetailPenjualan;
		this.barang = barang;
		this.qty = qty;
		this.price = price;
		this.gudang = gudang;
		this.subTotal = subTotal;
		this.bulanKadaluarsa = bulanKadaluarsa;
		this.discount = discount;
		this.pajak = pajak;
		this.createdBy = createdBy;
	}

	public BigDecimal getPajak() {
		return pajak;
	}

	public void setPajak(BigDecimal pajak) {
		this.pajak = pajak;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public Long getIdDetailPenjualan() {
		return idDetailPenjualan;
	}

	public void setIdDetailPenjualan(Long idDetailPenjualan) {
		this.idDetailPenjualan = idDetailPenjualan;
	}

	public BarangEntity getBarang() {
		return barang;
	}

	public void setBarang(BarangEntity barang) {
		this.barang = barang;
	}

	public Long getQty() {
		return qty;
	}

	public void setQty(Long qty) {
		this.qty = qty;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public GudangEntity getGudang() {
		return gudang;
	}

	public void setGudang(GudangEntity gudang) {
		this.gudang = gudang;
	}

	public BigDecimal getSubTotal() {
		return subTotal;
	}

	public void setSubTotal(BigDecimal subTotal) {
		this.subTotal = subTotal;
	}

	public void setPenjualan(PenjualanEntity penjualan) {
		this.penjualan = penjualan;
	}

	public PenjualanEntity getPenjualan() {
		return penjualan;
	}

	public String getBulanKadaluarsa() {
		return bulanKadaluarsa;
	}

	public void setBulanKadaluarsa(String bulanKadaluarsa) {
		this.bulanKadaluarsa = bulanKadaluarsa;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

}
